﻿using HupunSDK.Core;
using HupunSDK_API.Response;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;

namespace HupunSDK_API.Request
{
    public class ModifyRemarkRequest : BaseRequest<HupunResponse>
    {
        [JsonProperty("bill_code")]
        public string BillCode { get; set; }

        [JsonProperty("orders")]
        public List<OrderDetailRemark> Orders { get; set; }

        [JsonProperty("remark")]
        public string Remark { get; set; }

        public override string GetApiName() => "/erp/opentrade/modify/remark";

        public override HttpMethod GetHttpMethod() => HttpMethod.Post;
    }

    public class OrderDetailRemark
    {
        [JsonProperty("remark")]
        public string Remark { get; set; }

        [JsonProperty("order_id")]
        public string OrderId { get; set; }

        public override string ToString()
        {
            return JsonConvert.SerializeObject(this);
        }
    }
}
